cmake_minimum_required(VERSION 3.22)
project(supermarket C)

set(CMAKE_C_STANDARD 99)

include_directories(${PROJECT_SOURCE_DIR}/include)

# 关键：批量匹配 src 目录下所有 .c 文件，存入变量 SRC_FILES
# file(GLOB 变量名 "路径匹配规则")：按指定规则匹配文件，将文件路径列表存入变量；
file(GLOB SRC_FILES "${PROJECT_SOURCE_DIR}/src/*.c")
# 用变量代替逐个文件，生成可执行文件
add_executable(supermarket ${SRC_FILES}
        src/card.c
        include/member.h
        src/member.c
        src/user.c
        include/user.h
        include/orders.h
        src/card.c
        src/orders.c
        include/card.h
        include/goods.h
        src/goods.c
        include/common.h
        src/common.c
)
